package com.groupfour.attendancemanagementsystem.service.impl;

import com.groupfour.attendancemanagementsystem.dao.LoginDao;
import com.groupfour.attendancemanagementsystem.entity.DO.AdminDO;
import com.groupfour.attendancemanagementsystem.entity.DO.StudentDO;
import com.groupfour.attendancemanagementsystem.entity.DO.TeacherDO;
import com.groupfour.attendancemanagementsystem.entity.DTO.UserLoginDTO;
import com.groupfour.attendancemanagementsystem.entity.VO.UserLoginVO;
import com.groupfour.attendancemanagementsystem.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("loginServiceImpl")
public class LoginServiceImpl implements LoginService {

    private LoginDao loginDao;

    @Autowired
    public LoginServiceImpl(LoginDao loginDao) {
        this.loginDao = loginDao;
    }

    // 管理员登录
    @Override
    public AdminDO adminLogin(UserLoginDTO userLoginDTO) {
        return loginDao.adminLogin(userLoginDTO);
    }

    // 学生登录
    @Override
    public StudentDO studentLogin(UserLoginDTO userLoginDTO) {
        return loginDao.studentLogin(userLoginDTO);
    }

    // 教师登录
    @Override
    public TeacherDO teacherLogin(UserLoginDTO userLoginDTO) {
        return loginDao.teacherLogin(userLoginDTO);
    }
}
